package com.kuang.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kuang.entity.GiftWarehouse;
import com.kuang.mapper.GiftWarehouseMapper;
import com.kuang.service.GiftWarehouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 类说明
 *
 * @author liaosheng
 * @date 2021-04-29
 */
@Service
public class GiftWarehouseServiceImpl implements GiftWarehouseService {

    @Autowired
    private GiftWarehouseMapper giftWarehouseMapper;

    @Override
    public Page<GiftWarehouse> page() {
        Page<GiftWarehouse> page = new Page<>(2, 5);
        return giftWarehouseMapper.selectPage(page,null );
    }

    @Override
    public GiftWarehouse add(GiftWarehouse giftWarehouse) {
        giftWarehouseMapper.insert(giftWarehouse);
        return giftWarehouse;
    }

    @Override
    public void update(GiftWarehouse giftWarehouse) {
        giftWarehouseMapper.updateById(giftWarehouse);
    }
}
